<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="../inc/TagLibs.jsp"%>
<c:set var="pageTitle" value="选择联系人" />
<%@ include file="../inc/Title.jsp"%>
<head>
<link rel="stylesheet" type="text/css" href="/css/base.css" />
<link href="/css/Query.css" rel="stylesheet" type="text/css">
<script src="/js/QueryList.js"></script>
<script language="javascript">
	function doSelect(index){
		var ob_arr = document.getElementsByName("query_checkbox");
		var arr;
		if(ob_arr.length>=index){
			arr=new Array(ob_arr[index-1].value,ob_arr[index-1].getAttribute("phone"));
		}
		if (arr != null){
			parent.popRetVal=arr;
			parent.ClosePop();
		}
	}
	
	function DoubleClick(it){
		var ob_arr = document.getElementsByName("query_checkbox");
		var arr;
		if(ob_arr.length>=it.getAttribute("index")){
			arr=new Array(ob_arr[it.getAttribute("index")-1].value,ob_arr[it.getAttribute("index")-1].getAttribute("phone"));
		}
		if(arr==null){
			return;
		}
		parent.popRetVal=arr;
		parent.ClosePop();
	}
	
	function doCancel(){
		parent.ClosePop();
	}
	function doInit(){
		Window_Onload();
	}
</script>
</head>
<body oncontextmenu="return false" onload="doInit();"  class="sheet">
<div class="sheet-main" style="width:455px">
  <div class="sheet-top">
    <div class="content">
      <h2>选择${establishment.estName}的联系人</h2>
      <p>鼠标双击可以选中联系人</p>
    </div>
  </div>
  <div class="sheet-list">
    <div class="search-business">     
	     <div class="table-list">
	        <table width="100%">
						<tr>
							<th width="14"></th>
							<th width="15%">姓名</th>
							<th width="15%">职务</th>
							<th width="60%">备注</th>
							<th width="10%">操作</th>
						</tr>
						<c:forEach var="item" items="${contactList}" varStatus="i">
							<c:if test="${(i.index mod 2)==0}"><c:set var="trClass" value="query_list_data_tr1" /></c:if>
							<c:if test="${(i.index mod 2)!=0}"><c:set var="trClass" value="query_list_data_tr2" /></c:if>
							<c:set var="phoneStr" value="${item.phone}" />
							<c:if test="${item.mobile!=null && item.mobile!=''}">
								<c:if test="${phoneStr!=null && phoneStr!=''}"><c:set var="phoneStr" value="${phoneStr} " /></c:if>
								<c:set var="phoneStr" value="${phoneStr}${item.mobile}" />
							</c:if>
							<tr class="${trClass}" index="${i.index+1}" style='cursor:pointer;' ondblclick='javascript:DoubleClick(this)' onClick='javascript:ClickCheck(this)' onmouseout='javascript:mouseout(this)' onmouseover='javascript:mouseover(this)'>
								<td><input type="radio" name='query_checkbox' value="<c:out value="${item.contactName}" />" phone="<c:out value="${phoneStr}" />"></td>
								<td><c:out value="${item.contactName}" /></td>
								<td><c:out value="${item.possie}" /></td>
								<td><c:out value="${item.mark}" /></td>
								<td>
									<a href="javascript:doSelect('${i.index+1}');">选择</a>
								</td>
							</tr>
						</c:forEach>
					</table>
		     </div>  
	   </div>  
  </div>
	<div class="blank12"></blank>
</div>
</body>
</html>